package com.yc.system.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.yc.framework.baseClass.BaseEntity;

import java.time.LocalDateTime;
import java.util.Date;

import com.yc.framework.config.CustomFloatDeserializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;

/**
 * <p>
 * 订单交易
 * </p>
 *
 * @author 1850140986@qq.com
 * @since 2022-12-06
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Accessors(chain = true)
@TableName("t_book_order")

public class BookOrder extends BaseEntity<BookOrder>{
    private static final long serialVersionUID = 1L;


    /**
     * 订单ID
     */
    @TableId(value = "order_id", type = IdType.AUTO)
    private Integer orderId;


    /**
     * 订单号
     */
    @TableField(value = "order_num")
    private String orderNum;
    

    /**
     * 买家ID
     */
    @TableField("user_id")
    private Integer userId;

    /**
     * 图书ID
     */
    @TableField("book_id")
    private Integer bookId;

    /**
     * 数量
     */
    @TableField("quantity")
    private Integer quantity;

    /**
     * 单价
     */
    @TableField("price")
    @JsonDeserialize(using = CustomFloatDeserializer.class)
    private Float price;

    /**
     * 总价
     */
    @TableField("money")
    @JsonDeserialize(using = CustomFloatDeserializer.class)
    private Float money;

    /**
     * 订单状态：1待付款  2待商家确认 3待商家确认交货 4待确认收货 5待评论 6退货退款中 7已签收 8已退货退款 9已取消 10商家取消 11商家确认退货
     */
    @TableField("order_status")
    private Integer orderStatus;

    /**
     * 生成时间
     */
//    @TableField(fill = FieldFill.INSERT)
    @TableField("order_create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date orderCreateTime;

    /**
     * 确认时间
     */
    @TableField("order_confirm_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date orderConfirmTime;

    /**
     * 完成时间
     */
    @TableField("order_finish_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date orderFinishTime;



}